<?php
class AdminCP_Plugin_Core extends Zend_Controller_Plugin_Abstract
{
	public static function setAdminNavigation()
	{
		$front = Zend_Controller_Front::getInstance();
		$layout = $front->getParam('bootstrap')->getResource('layout');
		$view = $layout->getView();	
		$config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'navAdmin');
		$container = new Zend_Navigation($config);
		if (User_Plugin_Core::checkAuth()) {
			$container->addPage(array(
				'label'  => 'Logout',
				'module' => 'User',
				'controller' => 'auth',
				'action' => 'logout',
			));
		}
		$view->navigation($container);
	}
}